// pages/school/school.js
const API = require("../../http/API")
const http = require("../../http/http")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    option: [{
        text: "全部课程",
        iconUrl: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h1-b_2211.png"
      },
      {
        text: "直播班",
        iconUrl: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h2-o_2211.png"
      },
      {
        text: "特训班",
        iconUrl: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h3-p_2211.png"
      },
      {
        text: "入门班",
        iconUrl: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h4-g_2211.png"
      },
      {
        text: "学习问答",
        iconUrl: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h5-p_2211.png"
      },
      {
        text: "学员作业",
        iconUrl: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h6-r_2211.png"
      },
      {
        text: "怎样学习",
        iconUrl: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h7-y_2211.png"
      },
      {
        text: "关于我们",
        iconUrl: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h8-c_2211.png"
      },
    ],
    // 轮播
    lunbopic: null,
    // 热门推荐
    rementj: '',
    daka: '',
    student: '',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    // 学员作品
    http(API.student).then(res => {
      this.setData({
        student: res.data.data
      })
      console.log(res.data.data);
    })

    // 大咖老师
    http(API.daka).then(res => {
      this.setData({
        daka: res.data.data
      })
    })
    // 轮播
    http(API.schoolBanner).then(res => {
      this.setData({
        lunbopic: res.data.data
      })
    })
    // 热门课程
    http(API.professionals).then(res => {
      this.setData({
        rementj: res.data.data
      })
    })
  },
})